home *** CD-ROM | disk | FTP | other *** search
/ Champak 108 / jogo-disk-108.iso / Games / simple_tower_defense.swf / scripts / frame_3 / PlaceObject3_248_219 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2010-05-15  |  1KB  |  70 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.go == true)
  3.    {
  4.       this.removeMovieClip();
  5.    }
  6.    elb._width = el / ex * 34;
  7.    sc++;
  8.    if(sc >= stm)
  9.    {
  10.       slow = false;
  11.    }
  12.    if(slow == true)
  13.    {
  14.       _X = _X + xs / 6;
  15.       _Y = _Y + ys / 6;
  16.    }
  17.    if(slow == false)
  18.    {
  19.       _X = _X + xs;
  20.       _Y = _Y + ys;
  21.    }
  22.    if(_X < -20 && paid == false)
  23.    {
  24.       paid = true;
  25.       _root.deadenemies = _root.deadenemies + 1;
  26.       _root.lives -= 1;
  27.       this.removeMovieClip();
  28.    }
  29.    if(_root.lives <= 0)
  30.    {
  31.       _root.go = true;
  32.       _root.gotoAndStop(6);
  33.    }
  34.    if(el <= 0 && paid == false)
  35.    {
  36.       _root.cash += _root.lc;
  37.       _root.score += ex;
  38.       _root.deadenemies = _root.deadenemies + 1;
  39.       paid = true;
  40.    }
  41.    if(el <= 0 && paid == true)
  42.    {
  43.       this.removeMovieClip();
  44.    }
  45.    if(_root.goleft.hitTest(_X,_Y,true))
  46.    {
  47.       eb._rotation = 0;
  48.       xs = - s;
  49.       ys = 0;
  50.    }
  51.    if(_root.goright.hitTest(_X,_Y,true))
  52.    {
  53.       eb._rotation = 180;
  54.       xs = s;
  55.       ys = 0;
  56.    }
  57.    if(_root.goup.hitTest(_X,_Y,true))
  58.    {
  59.       eb._rotation = 90;
  60.       xs = 0;
  61.       ys = - s;
  62.    }
  63.    if(_root.godown.hitTest(_X,_Y,true))
  64.    {
  65.       eb._rotation = 270;
  66.       xs = 0;
  67.       ys = s;
  68.    }
  69. }
  70.